Copy/Paste Form

When developing a DataBlock with multiple forms, you may need to copy most or all of the objects from one form to another. Previously, this could only be done by copying each of the objects. Argos 4.1 adds a convenient way to copy an entire form by right-clicking on the form name and going to Copy Form.

Right-click menu on form name showing copy option.

The selected form is stored on the clipboard ready to be pasted into the current DataBlock or any other DataBlock. To paste the new form, right-click in the Forms pane and select Paste Form.

The copied form is called Copy (1) of Main.

 

Each copy of the form has its own variables. Argos automatically names the copied variables with the next sequential number. For example, DateEdit1 becomes DateEdit2, and ListBox1 becomes ListBox2. Notice how Button1 and Button2 become Button3 and Button4, respectively, which are the next sequential numbers.

List of system variables before copy Arrow pointing to the right List of variables after copy showing duplicated variables

Keep in mind that the Variables tab shows all variables in the DataBlock. When you copy a form, only the variables belonging to that form are copied. In the example above, Variable1 and Variable2 are manual variables, not form objects, and so they were not copied.


Important note: Because the new variables have different names, any SQL queries, data-aware objects, etc. on the form that refer to other objects will need to be updated as necessary to refer to the new, copied objects. When copying a form into the same DataBlock, these references point to the original variables from the first form. When copying a form between DataBlocks, the referenced variables may not exist at all in the new DataBlock.

One other thing to keep in mind is that the copy is based on the last saved state of the form. To ensure all desired changes are copied, commit the DataBlock before making the copy.